/**
 *  Copyright 2013 University Pierre & Marie Curie - UMR CNRS 7606 (LIP6/MoVe)
 *  All rights reserved.   This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Initial contributor:
 *    Jean-Luc Amitousa - Thanh Cong - <jeanluc.amitousa.mankoy@gmail.com>
 *
 *  Mailing list:
 *    lom-messan.hillah@lip6.fr
 */
package sdmakerz_v1.coresyntax.io;

import org.eclipse.emf.ecore.resource.Resource;

import sdmakerz_v1.coresyntax.generator.interfaces.IInputData;


public class InputDataImpl implements IInputData {
	private Resource input;
	private String outputBasedName;
	
	public void setInput(Resource input) {
		this.input= input;
		
		this.outputBasedName=
				input
				.getURI()
				.toString()
				.substring(
						"file:/".length()+
						SDMakerIO.getRootDirNameForInput().length()+
						"/".length());
	
		this.outputBasedName= 
				this
				.outputBasedName
				.substring(0, outputBasedName.length() - ".sdm".length());
	}
	
	public Resource getInput(){ return input; }
	public String getOutputBasedName(){ return outputBasedName; }
}
